#include "CollisionHelper.h"
#include "Entity.h"

using namespace model;

CollisionHelper::CollisionHelper(std::map<int, Entity*> &activeEntities, std::map<int, Entity*> &passiveEntities)
{
	this->activeEntities  = activeEntities;
	this->passiveEntities = passiveEntities;	
}

CollisionHelper::CollisionHelper()
{
}

CollisionHelper::~CollisionHelper(void)
{
}

void CollisionHelper::addActiveEntity(Entity* e)
{
	activeEntities.insert(pair<int, Entity*>(e->getId(), e));
}

void CollisionHelper::addPassiveEntity(Entity* e)
{
	passiveEntities.insert(pair<int, Entity*>(e->getId(), e));
}

void CollisionHelper::removeEntity(Entity* e)
{
	if (passiveEntities.find(e->getId()) != passiveEntities.end())
		passiveEntities.erase(e->getId());

	if (activeEntities.find(e->getId()) != activeEntities.end())
		activeEntities.erase(e->getId());
}